<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');

$a = session_id();if(empty($a)) session_start();
include_once dirname(__FILE__).'/class/functions.php';
$logat = is_logat(); /// esti logat sau nuh?! 
$adm=0; /// default drepturi administratoresti ZERO
if(!isset($path) || empty($path)){ 
$path='';
$_SESSION["root_path"]=substr($_SERVER['REQUEST_URI'],0,strrpos($_SERVER['REQUEST_URI'],'/')).'/';  }
if(isset($_SESSION['logat']) && $_SESSION['logat'] == "admin" )
    {
    $adm=1;
        }
            ?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="icon" href="favicon.jpg" type="image/gif" sizes="16x16" /> 
        <link rel="stylesheet" type="text/css" href="./style/style.css" />
        <title></title>
    </head>
    <body>
        <? 
        what_header();

                    ?>
        <div id="content">
            <div id="content_inside">
                    <div id="content_inside_sidebar">
                        <ul>
                            <li><a href ="<? echo $path;?>index.php#home_stuff" id="show_home"> Home</a><br />
                            </li><li><a href ="<? echo $path;?>index.php#telefon_stuff" id="show_tel"> Carte Telefon</a><br /></li>
                            <li><a href ="<? echo $path;?>index.php#rezervari_stuff" id="show_rezerv"> Rezervari</a><br /></li>    
                            <li><a href ="<? echo $path;?>index.php#download_stuff" id="show_down"> Downloads</a><br /></li> 
                                           
                         </ul>
                                 
                    </div>
            <div id="content_inside_main">
                <div id="home_stuff" style="display: none">
                    <div id="news_stuff">
                                 <? echo list_news(); ?>
                    </div>
                    <span id="older"><h2>Mai vechi >> </h2> </span>
		</div>
                <div id="telefon_stuff" style="display: none">
                    Cauta:<input type="text" id="cauta_tel" /><br/>
                    <div id="list_tel">
                        <?    list_tel($adm); ?>
                    </div>

                </div>
                
                <div id="rezervari_stuff" style="display: none">
                   <?
                            $search="<div id='search_rez'>";
                            $perioade=  pt_rezervari("perioade", "perioada");
                            $sali=  pt_rezervari("sali", "sala");
                            $categorii= pt_rezervari("categorii", "categoria");
                            $anii=pt_rezervari("ani", "an");
                            $search.="</div>";
                                             
                   ?>
                    <form  method=post>
                    <?
                    echo $perioade;
                    echo $sali;
                    
                    ?>
                    Motiv: <input type="text" name="motiv" value=""/> 
                    Data: <input type="text"  id="datepicker" name="data" value=""/> <br/>
                    <a href="#" class="grey-button pcb"><span id="rez_submit">Submit</span></a> <br/> <br/>
                         </form>
                    <?if($logat){ ?>
                    <form>
                    <input type="radio" name="mod" class="sel_mod2" value="0" /> Cautare<br />
                    <input type="radio" name="mod" class="sel_mod2" value="1" /> Adaugare<br />
                    </form>  
                    <?  }?>
                     <hr /><br />
                     <div id="rez_se_res">
                                           
                         <div>      <?php  echo list_rez($adm); ?>             </div>
                      </div>

                 </div>
                
                <div id="download_stuff" style="display: none">
                    <form method="post">
                    <?
                    echo $categorii;
                    echo $anii;
                    
                    ?>
                    Cauta: <input type="text" name="keyw" value=""/> 
                    <a href="#" class="grey-button pcb"><span id="down_submit"> Submit</span></a> <br/> <h2> <a href="<? echo $path;?>up_down.php#"> Upload </a></h2><br/>
                    </form>
                    
                    <div id="list_down">
                        <? echo list_downloads($adm); ?>
                        <br/>
                        
                    </div>
                    
                </div>
                
        </div>

        
<? footer(); ?>        
    </body>
    
  <?  //echo $path; 
  ?>  
   
</html>
